import axios from '@iframe/tools/axios/axios.js'

/**
 * 电站发电概况
 */
export function queryElectricity(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/station/electricity`,
        method: 'get',
        params
    })
}

/**
 * 统计图
 */
export function queryStatistics(unit, params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/station/statistics/${unit}`,
        method: 'get',
        params
    })
}

/**
 * 通过状态分组查询
 */
export function queryStatus(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/station/status/count`,
        method: 'get',
        params
    })
}

/**
 * 查询排名
 */
export function queryRank(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/station/rank`,
        method: 'get',
        params
    })
}

export function myStation() {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/station/my`,
        method: 'get'
    })
}

export function queryDevicesStatus(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/devices/status/count`,
        method: 'get',
        params
    })
}

export function queryAlarm(params) {
    return axios.request({
        url: `/${import.meta.env.IFRAME_CONTEXT_PATH}/alarm/details`,
        method: 'get',
        params
    })
}
